package com.sprouting.personal.model.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import lombok.Data;

import javax.validation.constraints.Null;

/**
 * 账单组
 *
 * @author ：LX（长沙麓谷）
 * @date 创建时间： 2022/12/26 14:35
 */
@Data
@TableName("ps_billing_group")
public class BillingGroup extends BaseModel {

    /**
     * 主键
     */
    @TableId
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    private String id;
    /**
     * 隶属用户
     * @see User#getId()
     */
    private String userId;
    /**
     * 组名称
     */
    @CheckLength(min = 1, max = 150, message = "账单组名称超过长度限制")
    @CheckNotNull(message = "请输入账单组名称")
    private String name;
    /**
     * 内容
     */
    @CheckLength(min = 1, max = 2000, message = "内容超过长度限制")
    @CheckNotNull(message = "请输入内容")
    private String content;
    /**
     * 重要性
     * @see com.sprouting.personal.interfaces.common.Constant.Importance
     */
    private Integer importance;
}
